package QL;

import java.util.List;
import java.util.ArrayList;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;

public class ButlerServiceOpenStateGetResponse extends BaseQLResponse
{
    /// <summary>
    /// 服务是否开放
    /// </summary>
    public boolean IsOpen;

    /// <summary>
    /// 如果当前处于未开放状态，则该字段代表服务的开放时间。若该字段为空，则代表永久不开放。
    /// </summary>
    public String OpenTime;

    @Override
    public void DeserializeFromJson(JSONObject jsonObj)
    {
        JSONObject t = jsonObj.getJSONObject("error_response");
        if (t != null && !t.isNullObject())
        {
            ErrCode = t.getString("code");
            ErrMsg = t.getString("msg");
        }
        else
        {
            t = jsonObj.getJSONObject("butler_service_open_state_get_response");
            if (t.has("is_open"))
                IsOpen = t.getBoolean("is_open");
            if (t.has("open_time"))
                OpenTime = t.getString("open_time");
        }
    }
}
